package edu.fatec.veterinaria.dao;


import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public final class  GenericDao {



	public static Connection getConnection(){
		Connection con = null;
		try{

			   String driver = "net.sourceforge.jtds.jdbc.Driver"; 
			   String endereco = "jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=VeterinariaExotic;namedPipe=true"; 
			   String usuario = "sa";
			   String senha = "1234";

			Class.forName(driver);
			con = DriverManager.
			getConnection(endereco,usuario,senha);
			return con;
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			return con;				
		} catch (SQLException e){
			e.printStackTrace();
			return con;
		} catch (Exception e){
			e.printStackTrace();
			return con;
		}

	}

}

